package com.example.app.components


import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.size
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp

@Composable
fun ColumnStamp() {
    // verticalArrangement纵向排列方式
    // 特殊对齐方式参照flex
    // horizontalAlignment横向对齐方式
    Column(
        modifier = Modifier
            .size(200.dp, 100.dp)
            .background(Color.Green),
        verticalArrangement = Arrangement.SpaceAround
    ) {
        // weight可以设置当前元素在父元素中的占比,相当于flex属性
        Text(text = "Column1", modifier = Modifier.weight(0.8f, fill = true))
        Text(text = "Column2", modifier = Modifier.weight(0.2f))
    }
}

@Preview(
    showSystemUi = true
)
@Composable
fun ColumnStampPreview() {
    ColumnStamp()
}

